<html>
<body><br>
<table class="mytable">
<tr>
    <th align="center">Order id</th>
    <th align="center">Product id</th>
    <th align="center">Product name</th>
    <th align="center">Quantity</th>
    <th align="center">Price</th>
    <th align="center">&nbsp;</th>
</tr><tr>
<?php
if (count($this->paginator)):
    $pro = new Product(); // for retrieve user name
    foreach ($this->paginator as $orderdetail):
?>
<tr>
    <td><?php echo $this->escape($orderdetail->order_id);?></td>
    <td><?php echo $this->escape($orderdetail->product_id);?></td>
    <td><?php $row = $pro->fetchRow('id='.$orderdetail->product_id); echo $this->escape($row->name);?></td>    
    <td><?php echo $this->escape($orderdetail->quantity);?></td>
    <td><?php echo $this->escape($orderdetail->price);?></td>
    <td>
        <a href="<?php echo $this->url(array('controller'=>'orderdetail',
            'action'=>'update', 'order_id'=>$orderdetail->order_id, 'product_id'=>$orderdetail->product_id));?>">Edit</a>
        <a href="<?php echo $this->url(array('controller'=>'orderdetail',
            'action'=>'delete', 'order_id'=>$orderdetail->order_id, 'product_id'=>$orderdetail->product_id));?>">Delete</a>
    </td>
</tr>
<?php endforeach; echo "</tr></table>"; endif; ?><hr>
<?= $this->paginationControl($this->paginator,
                             'Sliding',
                             'pagination.phtml'); ?>
</body>
</html>